<?php

namespace addons\moneylog\controller\api;

use addons\moneylog\model\MoneyLog;
use app\common\controller\Api;

class Index extends Api
{

    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];

    public function _initialize()
    {
        parent::_initialize();
    }

    public function index()
    {
        $this->error("当前插件暂无前台页面");
    }

    /**
     * 资金记录
     * @throws \think\exception\DbException
     */
    public function lists()
    {
        $limit = $this->request->param('limit',10);
        $status = $this->request->param('status',0);
        if($status)$where['status'] = $status;
        $model = new MoneyLog();
        $where['user_id'] = $this->auth->id;
        $ret = $model->where($where)->paginate($limit);
        $this->success('',$ret);
    }

}
